//
//  QXZuTuanTwoViewController.m
//  qiJi
//
//  Created by 凤利史 on 2018/4/18.
//  Copyright © 2018年 sunrose. All rights reserved.
//

#import "QXZuTuanTwoViewController.h"

#import "QXZuTuanTwoTableViewCell.h"
@interface QXZuTuanTwoViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *dataArr;

@end

@implementation QXZuTuanTwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self creationView];
    [self regeditCell];
    // Do any additional setup after loading the view.
}
- (void)creationView{
    self.title = @"组团骑行";
    UIButton *searchBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, screenScale(40), screenScale(36))];
    [searchBtn setImage:[UIImage imageNamed:@"team_nav_btn"] forState:UIControlStateNormal];
    [searchBtn addTarget:self action:@selector(pianoBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *rightItme = [[UIBarButtonItem alloc]initWithCustomView:searchBtn];
    self.navigationItem.rightBarButtonItem = rightItme;
    
    UIView *viewOfTit = [[UIView alloc] init];
    [self.view addSubview:viewOfTit];
    [viewOfTit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view);
        make.right.equalTo(self.view);
        make.height.offset(45);
        make.top.equalTo(self.view).with.offset(1);
        
    }];
    viewOfTit.backgroundColor = getColor(@"F2F2F2");
    
    UIButton *saoMiaoBtn = [[UIButton alloc] init];
    [viewOfTit addSubview:saoMiaoBtn];
    [saoMiaoBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(viewOfTit);
        make.right.equalTo(viewOfTit);
        make.bottom.equalTo(viewOfTit);
        make.top.equalTo(viewOfTit);
        
    }];
    [saoMiaoBtn setTitle:@"扫描二维码加入" forState:UIControlStateNormal];
    [saoMiaoBtn setTitleColor:getColor(@"999999") forState:UIControlStateNormal];
    saoMiaoBtn.titleLabel.font = [UIFont systemFontOfSize:13];
    saoMiaoBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    
    
    self.tableView = [[UITableView alloc] init];
    self.tableView.frame = CGRectMake(0, 45, DEF_SCREEN_WIDTH, DEF_SCREEN_HEIGHT - (KIsiPhoneX?84:64) - 45);
    
    self.tableView.tableFooterView = [[UITableView alloc] initWithFrame:CGRectZero];
    
    self.tableView.backgroundColor = [UIColor whiteColor];
   // self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
    
    
    
}
- (void)regeditCell{
    
    
    
    [self.tableView registerNib:[UINib nibWithNibName:@"QXZuTuanTwoTableViewCell" bundle:nil] forCellReuseIdentifier:@"QXZuTuanTwoTableViewCell"];
    
}

#pragma mark - ---------- Section的数量 ----------
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

#pragma mark - ---------- 每个Section的高度 ----------
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0;
}

#pragma mark - ---------- Cell的数量 ----------
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 22;
    
    
}

#pragma mark - ---------- 每个Cell的高度 ----------
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 77;
    
}
#pragma mark - ---------- 每个Cell的内容 ----------
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    QXZuTuanTwoTableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"QXZuTuanTwoTableViewCell" forIndexPath:indexPath];
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    
    return cell;
    
    
}

#pragma mark - ---------- 每个Cell的点击事件 ----------
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
    
    
}

- (void)pianoBtnClick{
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
